package ru.inse.web.components;

import java.util.Map;

import ru.inse.web.module.InseModule;
import ru.xeden.web.html.component.IComponent;
import ru.xeden.web.html.component.IComponentFactory;


public class InseComponentFactory
    implements IComponentFactory
{
    public static final String FACTORY_ID = "inse.main.component.factory";
    private InseModule inseModule;
    
    public InseComponentFactory(InseModule inseModule)
    {
        this.inseModule = inseModule;
    }
    
    @Override
    public IComponent createComponent(String id, Map<String, String> atts)
    {
        if (ModuleListComponent.ID.equals(id))
        {
            return new ModuleListComponent(inseModule);
        }
        else if (ContentComponent.ID.equals(id))
        {
            return new ContentComponent();
        }
        return null;
    }
}
